@echo off
set hour=%time:~0,2%
if %hour% LSS 10 (
    set hour=0%time:~1,1%
)
set version=%date:~0,4%%date:~5,2%%date:~8,2%%hour%%time:~3,2%%time:~6,2%
set depository=ds-content-factory
set namespaces=tenant-yfqm
set url=registry-vecps.gaccloud.com.cn
set pom=pom.xml
set vue=vue.config.js
set tag=%depository% %url%/%namespaces%/%depository%:%version%
set dockerfile=Dockerfile
set user="xucongcong913671@talkweb.com.cn@57891"
set password="Ty-Ai7-KDc8.3gb"

echo [start] build docker image
docker build -f %dockerfile% -t %depository% .
echo [end] build docker image

echo [start] tag image tag=%tag%
docker tag %depository% %tag%
echo [end] tag image

rem  登录私有镜像仓库
rem echo "[start] login to registry"
rem printf "$AK" | openssl dgst -binary -sha256 -hmac "$SK" | od -An -vtx1 | sed 's/[ \n]//g' | sed 'N;s/\n//'
rem docker login -u cn-south-1@[AK] -p [password] %url%
rem docker login -u %user% -p %password% %url%
rem echo "[end] login to registry"

echo [start] push tag to docker respitory
docker push %tag%
echo [end] push tag to docker respitory

pause&
